
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        车位使用添加
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all">

    <style>
        .imgs{display: none;}
        .picture{display: none;}
    </style>

</head>
<body>

<div class="x-body">
    <form class="layui-form layui-form-pane" action="${pageContext.request.contextPath}/parkingUsage/add" method="post" enctype="multipart/form-data" >
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <div class="layui-tab-content" >
                <div class="layui-tab-item layui-show">
<%--                    <input type="hidden" name="id" value="">--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>车位编号
                        </label>
                        <div class="layui-input-block">
                            <select name="parkingId" id="parking_id">
                                <c:forEach items="${maps.parkings}" var="parking">
                                    <option value="${parking.id}">${parking.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>车辆所有人
                        </label>
                        <div class="layui-input-block">
                            <select name="pid">
                                <c:forEach items="${maps.personnels}" var="personnel">
                                    <option value="${personnel.id}">${personnel.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>总费用(￥)
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="cost" autocomplete="off" placeholder="空制在80个汉字，160个字符以内"
                                   class="layui-input" value="">
                        </div>
                    </div>
                    <div class="layui-form-item" hidden>
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>使用性质
                        </label>
                        <div class="layui-input-block">
                            <input type="radio" name="state" value="1" title="有效" checked="checked" >
                            <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
                                <div>有效</div>
                            </div>
                            <input type="radio" name="state" value="0" title="无效">
                            <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
                                <div>无效</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="previewImg" class="layui-form-label">
                            <span class="x-red">*</span>车辆牌照
                        </label>
                        <input type="file" id="previewImg" name="image">
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>开始时间
                        </label>
                        <div class="layui-input-inline">
                            <input class="layui-input" name="startTime" placeholder="开始时间" id="LAY_demorange_s" value="" required>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>结束时间
                        </label>
                        <div class="layui-input-inline">
                            <input class="layui-input" name="endTime" placeholder="结束时间" id="END_demorange_s" value="" required>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" type="submit" lay-filter="add" lay-submit="">
                            保存
                        </button>
                    </div>
                    <!--</form>-->
                    <div style="height:100px;"></div>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/x-layui.js" charset="utf-8"></script>

<script>
    layui.use(['laydate','element','layer','form'], function(){
        form = layui.form();
        laydate = layui.laydate;//日期插件

        form.render();
        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                //end.min = datas; //开始日选好后，重置结束日的最小日期
                //end.start = datas //将结束日的初始值设定为开始日
            }
        };
        document.getElementById('LAY_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        };

        document.getElementById('END_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        };

    })
</script>

</body>
</html>